package com.mcay.easyexcel.utils;

import com.mcay.easyexcel.vo.ResultVO;

/**
 * 返回控制  工具类
 * Created by  longHe
 * 2021/8/20 19:18
 */
public class ResultVOUtil {

    public static ResultVO<Object> success() {
        ResultVO<Object> resultVO = new ResultVO<>();
        resultVO.setCode(0);
        resultVO.setMessage("成功！");
        return resultVO;
    }

    public static ResultVO<Object> success(Object o) {
        ResultVO<Object> resultVO = new ResultVO<>();
        resultVO.setCode(0);
        resultVO.setMessage("成功！");
        resultVO.setData(o);
        return resultVO;
    }

    public static ResultVO<Object> error() {
        ResultVO<Object> resultVO = new ResultVO<>();
        resultVO.setCode(500);
        resultVO.setMessage("失败！");
        return resultVO;
    }

    public static ResultVO<Object> error(String msg) {
        ResultVO<Object> resultVO = new ResultVO<>();
        resultVO.setCode(500);
        resultVO.setMessage(msg);
        return resultVO;
    }

}